{*<!--

+---------------------------------------------------------------------------+
| OpenX v2.8                                             |
| =========                             |
|                                                                           |
| Copyright (c) 2003-2009 OpenX Limited                                     |
| For contact details, see: http://www.openx.org/                           |
|                                                                           |
| This program is free software; you can redistribute it and/or modify      |
| it under the terms of the GNU General Public License as published by      |
| the Free Software Foundation; either version 2 of the License, or         |
| (at your option) any later version.                                       |
|                                                                           |
| This program is distributed in the hope that it will be useful,           |
| but WITHOUT ANY WARRANTY; without even the implied warranty of            |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             |
| GNU General Public License for more details.                              |
|                                                                           |
| You should have received a copy of the GNU General Public License         |
| along with this program; if not, write to the Free Software               |
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA |
+---------------------------------------------------------------------------+
$Id: advertiser-index-list.html 79311 2011-11-03 21:18:14Z chris.nutting $

-->*}


<div class='tableWrapper'>
    <div class='tableHeader'>
        <ul class='tableActions'>
            <li>
                <a href='advertiser-edit.php' class='inlineIcon iconAdvertiserAdd'>{t str=AddClient}</a>
            </li>
            <li class='inactive activeIfSelected'>
                <a id='deleteSelection' href='#' class='inlineIcon iconDelete'>{t str=Delete}</a>
                
                {literal}
                <script type='text/javascript'>
                <!--
        
                $('#deleteSelection').click(function(event) {
                    event.preventDefault();
                    
                    if (!$(this).parents('li').hasClass('inactive')) {
                        var ids = [];
                        $(this).parents('.tableWrapper').find('.toggleSelection input:checked').each(function() {
                            ids.push(this.value);
                        });
                      
                        if (!tablePreferences.warningBeforeDelete || confirm("{/literal}{t str=ConfirmDeleteClients}{literal}")) {
                            window.location = 'advertiser-delete.php?clientid=' + ids.join(',');
                        }
                    }
                });
                
                //-->
                </script>
                {/literal}
            </li>
        </ul>
        
        <ul class='tableFilters alignRight'>
            <li>
                <div class='label'>
                    Show
                </div>
                
                <div class='dropDown'>
                    <span><span>{if $hideinactive}Active advertisers{else}All advertisers{/if}</span></span>
                    
                    <div class='panel'>
                        <div>
                            <ul>
                                <li><a href='advertiser-index.php?hideinactive=0'>All advertisers</a></li>
                                <li><a href='advertiser-index.php?hideinactive=1'>Active advertisers</a></li>
                            </ul>
                        </div>
                    </div>
                    
                    <div class='mask'></div>
                </div>
            </li>
            {if !empty($topPager->links)}
            <li>
              <div class="pager">
                <span class="controls">{$topPager->links}</span>
              </div>
            </li>
            {/if}
        </ul>

        <div class='clear'></div>

        <div class='corner left'></div>
        <div class='corner right'></div>
    </div>

    <table cellspacing='0' summary=''>
        <thead>
            <tr>
              <th class='first toggleAll'>
                  <input type='checkbox' />
                </th>
                <th class='{ox_column_class item=name order=up default=1}'>
                    {ox_column_title item=name order=up default=1 str=Name url=advertiser-index.php}
                </th>
                <th class='last alignRight'>&nbsp;
                    
                </th>
            </tr>
        </thead>

{if !$from|@count}
        <tbody>
            <tr class='odd'>
                <td colspan='3'>&nbsp;</td>
            </tr>
            <tr class='even'>
                <td colspan='3' class="hasPanel">
                    <div class='tableMessage'>
                        <div class='panel'>
                        
                        {if $hideinactive}
                            {$aCount.advertisers_hidden} {t str=InactiveAdvertisersHidden}
                        {else}
                            {t str=$listEmptyStr|default:"NoClients"}
                        {/if}
                        
                            <div class='corner top-left'></div>
                            <div class='corner top-right'></div>
                            <div class='corner bottom-left'></div>
                            <div class='corner bottom-right'></div>
                        </div>
                    </div>
                    
                    &nbsp;
                </td>
            </tr>
            <tr class='odd'>
                <td colspan='3'>&nbsp;</td>
            </tr>
        </tbody>
        
{else}
        <tbody>
    {cycle name=bgcolor values="even,odd" assign=bgColor reset=1}
    {foreach key=clientId item=client from=$from}
        {cycle name=bgcolor assign=bgColor}
            <tr class='{$bgColor} {if $client.type == $MARKET_TYPE}systemAdvertiser{/if}'>
                <td class='toggleSelection'>
                  {if $client.type != $MARKET_TYPE}
                    <input type='checkbox' value='{$clientId}' />
                  {/if}
                </td>
                <td>
                  {if $client.type == $MARKET_TYPE} {* no link, just name, and don't display system ids *}
                    <span class='inlineIcon iconAdvertiserSystem'>{$client.clientname|escape:html}</span>
                  {else}
                    <a href='advertiser-edit.php?clientid={$clientId}' class='inlineIcon iconAdvertiser'>{$client.clientname|escape:html}</a>
                    {ox_entity_id type="Advertiser" id=$clientId}
                  {/if}   
                </td>
                <td class='alignRight horizontalActions'>
                    <ul class='rowActions'>
                        <li>
                            <a href='campaign-edit.php?clientid={$clientId}' class='inlineIcon {if $client.type == $MARKET_TYPE}iconCampaignSystemAdd{else}iconCampaignAdd{/if}'>{t str=AddCampaign}</a>
                        </li>
                        <li>
                            <a href='advertiser-campaigns.php?clientid={$clientId}' class='inlineIcon {if $client.type == $MARKET_TYPE}iconCampaignsSystem{else}iconCampaigns{/if}'>{t str=Campaigns}</a>
                        </li>
                    </ul>
                </td>
            </tr>
    {/foreach}
       </tbody>
{/if}
{if !empty($pager->links)}
    <tbody class="tableFooter">
        <tr>
        <td  colspan="3">
              <div class="pager">
                <span class="summary">{$pager->summary}</span>
                <span class="controls">{$pager->links}</span>
              </div>
        </td>
        </tr>
    </tbody>
{/if}
    </table>
</div>
